<template>
	<view style="background-color: #F3F4F5;height: 100vh;"> 
		<view class="reBox">
			<view class="czje">
				提现金额
			</view>
			<view class="flex_r_start">
				<view class="dw">￥</view>
				<view class="input">
					<input type="text" v-model="money" />
				</view>
			</view>
		</view>
		<view class="flex_r_between" style="background-color: #fff;padding: 0  32rpx 28rpx;box-sizing: border-box;">
			<view class="ktxje">可提现金额：￥{{amount}}</view>
			<view class="qbtx" @click="money=amount">全部提现</view>
		</view>
		<view class="" style="margin-top: 20rpx;"> 
			<view class="item flex_item_center" style="border-bottom: 1px solid #DDDDDD;">
				<image style="width: 40rpx;height: 40rpx;margin-right: 24rpx;" src="../../static/spokesmanImg/icon/zfb.png" mode=""></image>提现到支付宝
			</view>
			<view class="item flex_r_between" style="border-bottom: 1px solid #DDDDDD;">
				账户<input type="text" v-model="account" placeholder="请输入完整账户" />
			</view>
			<view class="item flex_r_between">
				收款人<input type="text" v-model="name" placeholder="请输入完整姓名" />
			</view>
		</view>
		<view class="submit" @click="withdraw">
			提交
		</view>
		<!-- <uni-popup ref="popup">123
			<uni-popup-message  :message="message" :duration="2000"></uni-popup-message>
		</uni-popup> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				iszhifu:1,
				money:'',
				amount:'',
				account:'',
				name:'',
				message:'',
			};
		},
		onLoad() {
			this.$request('/app/user/getMyAccount','post',{
				access_token:uni.getStorageSync('access_token').replace(/^\"|\"$/g,'')
			}).then(res=>{
				this.amount=res.content.account
			})
		},
		methods:{
			withdraw(){
				this.$request('/app/user/withdraw','post',{
					access_token:uni.getStorageSync('access_token').replace(/^\"|\"$/g,''),
					account:this.account,
					name:this.name,
					money:this.money
				}).then(res=>{
					// this.message=res.message
					// this.$refs.popup.open()
					uni.showToast({
						title:res.message,
						duration:2000,
						icon:'none'
					})
					this.$request('/app/user/getMyAccount','post',{
						access_token:uni.getStorageSync('access_token').replace(/^\"|\"$/g,'')
					}).then(res=>{
						this.amount=res.content.account
					})
				})
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	@import url("@/static/css/flex.css");
	.submit{
		width: 660rpx;
		height: 80rpx;
		background: #DB1B22;
		border-radius: 40rpx;
		margin: 40rpx auto;
		font-size: 34rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		text-align: center;
		line-height: 80rpx;

	}
	.qbtx{
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #00609B;

	}
	.ktxje{
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #9DA5A8;

	}
	.item{
		height: 100rpx;
		padding: 0 40rpx;
		background-color: #fff;
		font-size: 28rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #111111;
		input{
			width: 80%;
			height: 100%;
		}
	}
	.reBox{
		width: 100%;
		height: 300rpx;
		background: #FFFFFF;
		padding: 28rpx 32rpx;
		box-sizing: border-box;
		.czje{
			font-size: 32rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #111111;

		}
		.dw{
			width: 24px;
			height: 33px;
			font-size: 48rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #111111;
			margin-top: 115rpx;
		}
		.input{
			font-size: 100rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #111111;
			margin-top: 50rpx;
			margin-left: 20rpx;
			input{
				height: 100%;
				border-bottom: 1px solid #DDDDDD;
			}
		}
	}
</style>
